package com.lam.mall.mapper;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lam.mall.entity.ProdSku;

/**
 * 商品skuMapper接口
 * 
 * @author admin
 * @date 2023-04-22
 */
public interface ProdSkuMapper extends BaseMapper<ProdSku>{

	@Update("update mall_prod_sku set del_status=0 where prod_id=#{prodId}")
	int logicDeleteByProdId(@Param("prodId") String prodId);

	@Delete("delete from mall_prod_sku where prod_id=#{prodId}")
	int deleteByProdId(String prodId);
	
	
	/**
	 * 返回sku库存
	 * @param skuCollect
	 */
	void returnStock(@Param("skuCollect") Map<String, Integer> skuCollect);
	/**
	 * 修改销量
	 * @param skuCollect
	 */
	void updateSoldNum(@Param("skuCollect") Map<String, Integer> skuCollect);

	int updateStocks(ProdSku sku);


}
